<?php
  include_once dirname(__FILE__)."/database/database.class.php";
  include_once dirname(__FILE__)."/includes/print_images.inc.php";
?>

<!DOCTYPE HTML>
<html>

<head>
	<meta http-equiv="Content-type" content="text/html;charset=utf-8">
	<title>Magic the Gathering Card Collection Tool</title>
  <link rel="stylesheet" type="text/css" href="./styles/default.css">
  <link rel="stylesheet" type="text/css" href="./styles/menu.css">
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js" type="text/javascript"></script>

  <script type="text/javascript">
    var scroller;

    function create_scroller(divname, url, GET_parameters)
    {
      scroller = new CardScroller(divname, url, GET_parameters);
      scroller.setShowTooltip(true);
      scroller.setShowFooter(true);
      scroller.initialize_cards();
    }
  </script>
</head>

<?php
  $onload = "";
  if(isset($_GET['expansionName']))
  {
    $ID = $db->getExpansionID($_GET['expansionName']);
    $onload = "onload=\"create_scroller('card_container', './php_scripts/getCards.php', {id: $ID, type: 'expansion'});\"";
  }
  
  echo '<body ' . $onload. '>';

  include dirname(__FILE__)."/includes/header.inc.php";
  include dirname(__FILE__)."/includes/menu.inc.php";
?>

<?php
  if(isset($_GET["expansionName"]))
  {
    $sourceLocation = "expansionName";
  }
  else
  {
    $sourceLocation = "default";
  }

  include dirname(__FILE__)."/includes/expansions/".$sourceLocation.".inc.php";
  include dirname(__FILE__)."/includes/footer.inc.php";
?>

  </body>‎
</html>
